# 需要联网
# source sub06_opencv.sh 4.7.0
wget -P ~/Downloads https://codeload.github.com/opencv/opencv/zip/refs/tags/$1
unzip ~/Downloads/$1 -d ~/Downloads
cd ~/Downloads/opencv-$1

mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv$1 -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=OFF -D WITH_QT=ON -D WITH_GTK=ON -D WITH_OPENGL=ON ..
sudo make -j$(nproc)
sudo make install


# "opencv2/gapi.hpp: No such file or directory"
# BUILD_EXAMPLES=OFF
#

# libpng warning: Application built with libpng-1.2.54 but running with 1.6.37
